<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Register_model extends CI_Model {
	function __construct(){
		parent:: __construct();
		$this->load->database();
	}
	
          function table_user(){
                    $this->db->select('*');
		$this->db->from('user');
          }

	function check_unique_uname($username){
                    $this->table_user();
		$this->db->where('username_user',$username);
		$count = $this->db->count_all_results();
                    return $count;
	}

          function check_login($username){
                    $this->table_user();
                    $this->db->where('username_user', $username);
                    return $this->db->get();
          }

          function submit_register($data_register){
                    $this->db->insert('user',$data_register);

          }

}
